package main

import (
	"fmt"
	"path"
	"strings"
)

func main() {
	fullFilename := "/Users/itfanr/Documents/test.txt"
	fmt.Println("fullFilename =", fullFilename)

	// 文件全名
	var filenameWithSuffix string
	filenameWithSuffix = path.Base(fullFilename)
	fmt.Println("filenameWithSuffix =", filenameWithSuffix)

	// 文件扩展名
	var fileSuffix string
	fileSuffix = path.Ext(filenameWithSuffix)
	fmt.Println("fileSuffix =", fileSuffix)

	// 文件前名
	var filenameOnly string
	filenameOnly = strings.TrimSuffix(filenameWithSuffix, fileSuffix)
	fmt.Println("filenameOnly =", filenameOnly)

	ListDir := 0x0001
	fmt.Println(0 & 0x0001)
}
